﻿#include "stdafx.h"
#include "AstIndex.h"
#include "utility.h"
#include "SArrayType.h"
#include "CodeGenerate/IndexGen.h"

CodeGen * AstIndex::makeGen(SiContext * parent)
{
	IndexGen* p = new IndexGen();
	p->expr = expr->makeGen(parent);
	p->index = index->makeGen(parent);

	auto x = dynamic_cast<SArrayType*>(p->expr->type);
	p->type =  x->memberType;
	return p;
}
